const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_project_info', {
    id: {
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true,
      comment: "唯一标识"
    },
    parallelProjectId: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "立项用地规划许可原信息ID",
      field: 'parallel_project_id'
    },
    projectCode: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "项目编码",
      field: 'project_code'
    },
    projectName: {
      type: DataTypes.STRING(200),
      allowNull: true,
      comment: "项目名称",
      field: 'project_name'
    },
    projectType: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "项目类型",
      field: 'project_type'
    },
    projectCategory: {
      type: DataTypes.STRING(10),
      allowNull: true,
      comment: "项目类别",
      field: 'project_category'
    },
    regionCode: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "地区代码",
      field: 'region_code'
    },
    certificateType: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "证书类型",
      field: 'certificate_type'
    },
    certificateNumber: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "证书编码",
      field: 'certificate_number'
    },
    placeCode: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "地点代码",
      field: 'place_code'
    },
    constructionUnit: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "建设单位",
      field: 'construction_unit'
    },
    constructPer: {
      type: DataTypes.CHAR(1),
      allowNull: true,
      comment: "建设性质",
      field: 'construct_per'
    },
    theIndustry: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "行业代码",
      field: 'the_industry'
    },
    theIndustryName: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "行业名称",
      field: 'the_industry_name'
    },
    industry: {
      type: DataTypes.STRING(20),
      allowNull: true,
      comment: "国标行业"
    },
    name: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "国标行业名称"
    },
    totalInvestment: {
      type: DataTypes.DECIMAL(20,0),
      allowNull: true,
      comment: "总投资",
      field: 'total_investment'
    },
    investmentSource: {
      type: DataTypes.STRING(8),
      allowNull: true,
      comment: "投资来源",
      field: 'investment_source'
    },
    foreignAbroadFlag: {
      type: DataTypes.CHAR(1),
      allowNull: true,
      comment: "是否外商投资\/境外投资",
      field: 'foreign_abroad_flag'
    },
    isRealName: {
      type: DataTypes.CHAR(1),
      allowNull: true,
      comment: "是否实名",
      field: 'is_real_name'
    },
    applyTime: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "立项时间",
      field: 'apply_time'
    },
    isDeleted: {
      type: DataTypes.TINYINT,
      allowNull: true,
      comment: "1删除 0未删除",
      field: 'is_deleted'
    },
    createdUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'created_user'
    },
    createdTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "本系统创建时间",
      field: 'created_time'
    },
    updatedUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'updated_user'
    },
    updatedTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'updated_time'
    }
  }, {
    sequelize,
    tableName: 'base_project_info',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
